package com.timoon.webcomponent.utility.product.linepic;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.Panel;

import com.timoon.sample.utils.SystemConfig;
import com.timoon.webcomponent.utility.common.HorizontalTab4Panel;
import com.timoon.webcomponent.utility.common.HorizontalTab4Parameter;
import com.timoon.webcomponent.utility.product.BaseProductPanel;
import com.timoon.webcomponent.utils.WebConstantor;

/**
 *<p>bootstrap.tab 四个选项卡，每一个选项卡里横放商品小图片</p>
 *<p>可以直接被page引用</p>
 *<p>public</p>
 *<p>Company:timoon</p>
 *@author 付乐天
 *@version 1.0 */

public class HorizontalList4PicProductPanel extends BaseProductPanel {
	
	private Integer max;
	
	private Class<? extends WebPage> targetPage;
	
	public HorizontalList4PicProductPanel(String id,Integer max,Class<? extends WebPage> targetPage) {
		super(id);
		// TODO Auto-generated constructor stub
		this.max=max;
		
		this.targetPage=targetPage;
		
		renderPanel();
	}

	private void renderPanel() {
		// TODO Auto-generated method stub
		Panel[] panels=new HorizontalListPicProductPanel[]{
				new HorizontalListPicProductPanel("wk_inner1",SystemConfig.PRODUCT_TYPE_MAP.get("疯狂抢购"),targetPage),
				new HorizontalListPicProductPanel("wk_inner2",SystemConfig.PRODUCT_TYPE_MAP.get("猜您喜欢"),targetPage),
				new HorizontalListPicProductPanel("wk_inner3",SystemConfig.PRODUCT_TYPE_MAP.get("热卖商品"),targetPage),
				new HorizontalListPicProductPanel("wk_inner4",SystemConfig.PRODUCT_TYPE_MAP.get("热评商品"),targetPage)
			};
		HorizontalTab4Parameter parameter=new HorizontalTab4Parameter();
		parameter.setLabels(new String[]{WebConstantor.PRODUCT_TYPE_EQUAL_1_TITLE,WebConstantor.PRODUCT_TYPE_EQUAL_2_TITLE
				,WebConstantor.PRODUCT_TYPE_EQUAL_3_TITLE,WebConstantor.PRODUCT_TYPE_EQUAL_4_TITLE});
		parameter.setPanels(panels);
		
		add(new HorizontalTab4Panel("wk_tabs", parameter));
	}

	

}
